//
// Created by jsjxsy on 2022/8/22.
//
#include <iostream>
using namespace std;
int main() {
  int val;
  while (cin >> val, !cin.eof()) {
    if (cin.bad()) {
      throw runtime_error("io stream error");
    }
    if (cin.fail()) {
      cerr << "bad data,try again";
      cin.clear(istream::failbit);
      continue;
    }
  }
  return 0;
}